/* Copyright (c) 2021, National University of Defense Technology. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef BSR_COMMON_H
#define BSR_COMMON_H

namespace YHAMG
{

void VecBlockFill(int block_size, double a, double *x);
void VecBlockScale(int block_size, double a, double *x);
void VecBlockCopy(int block_size, const double *x, double *y);
void VecBlockAdd(int block_size, const double *x, double *y);
void VecBlockSub(int block_size, const double *x, double *y);
void VecBlockScaleAdd(int block_size, double a, const double *x, double *y);
void BSRBlockFill(int block_size, double a, double *A);
void BSRBlockScale(int block_size, double a, double *A);
void BSRBlockCopy(int block_size, const double *A, double *B);
void BSRBlockAdd(int block_size, const double *A, double *B);
void BSRBlockSub(int block_size, const double *A, double *B);
void BSRBlockScaleAdd(int block_size, double a, const double *A, double *B);
void BSRBlockMatVec(int block_size, const double *A, const double *x, double* y);
void BSRBlockMatVecAdd(int block_size, const double *A, const double *x, double* y);
void BSRBlockMatVecSub(int block_size, const double *A, const double *x, double* y);
void BSRBlockTranspose(int block_size, const double *A, double *B);
void BSRBlockMult(int block_size, const double *A, const double *B, double *C);
void BSRBlockMultAdd(int block_size, const double *A, const double *B, double *C);
void BSRBlockMultSub(int block_size, const double *A, const double *B, double *C);
void BSRBlockLUFactorize(int block_size, double *LU);
void BSRBlockLUVecSolve(int block_size, const double *LU, double* x);
void BSRBlockLUMatSolve(int block_size, const double *LU, double* X);
void BSRBlockMatLUSolve(int block_size, const double *LU, double* X);
double BSRBlockSum(int block_size, const double* A);


}

#endif